<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'jobs-grid',
    'dataProvider' => $model->search(),
    'columns' => array(
        'handled_date:date:Handling date',
        'type',
        'complete_date:date:Completed date',
        'signed_by:text:Signed',
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
<div class="row buttons">
        <?php
        $this->widget('zii.widgets.jui.CJuiButton',array(
                'name'=>'create',
                'caption'=>'Add jobs',
                'value'=>"create",
        ));
?>
</div>
<?php
$jobsUrl = CHtml::normalizeUrl(array('jobs/create','cargo_id'=>$model->foreign_key));
$script =<<<EOD
$('input#create').click(function(){
    $.simplelogdialog.Form({url:'$jobsUrl'});
});
EOD;
$cs = Yii::app()->getClientScript();
$cs->registerScript('Jobs#View',$script);
?>